package cn.it.Service.impl;

import cn.it.Service.ICarServices;
import cn.it.domain.Car;

import cn.it.mapper.CarMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service

public class CarServicesImpl implements ICarServices {
    @Autowired
    private CarMapper CarMapper;


    @Override
    public Car SelectOne(Integer id) {
        if(id==null){
            System.out.println("请输入id");
            return null;
        }
        else{
            System.out.println("请调用数据库");
            Car car = CarMapper.SelectOne(id);
            return car;
        }

    }

    @Override
    public List<Car> SelectAll() {
        return CarMapper.SelectAll();
    }
}
